package main

import "fmt"

func main() {
	fmt.Printf("%#v", construct2DArray([]int{1, 2, 3}, 1, 3))
}
func construct2DArray(original []int, m int, n int) (res [][]int) {
	l := len(original)
	if m*n != l {
		return
	}
	res = make([][]int, m)
	for i := 0; i < m; i++ {
		res[i] = make([]int, n)
		copy(res[i], original[i*n:i*n+n])
	}
	return
}
